package com.ruoyi.datastatistics.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 公摊用户关联对象 public_share_user_join
 *
 * @author gdqt
 * @date 2025-05-13
 */
@Data
@TableName("t_public_share_user_join")
public class PublicShareUserJoin extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @TableId(value="id",type = IdType.AUTO)
    private Long id;

    /** 租户号 */
    @Excel(name = "租户号")
    @TableField("tenant_id")
    private String tenantId;

    /** 公摊主键Id */
    @Excel(name = "公摊主键Id")
    @TableField("public_share_id")
    private String publicShareId;

    /** 能耗分类;水，电，气 */
    @Excel(name = "能耗分类;水，电，气")
    @TableField("energy_type")
    private Long energyType;

    /** 用户编号 */
    @Excel(name = "用户编号")
    @TableField("user_id")
    private String userId;

    /** 表编号 */
    @Excel(name = "表编号")
    @TableField("terminal_id")
    private String terminalId;

    /** 公摊类别;公摊，独立 */
    @Excel(name = "公摊类别;公摊，独立")
    @TableField("public_share_type")
    private Long publicShareType;

    /** 计算类型；1：加；2：减 */
    @Excel(name = "计算类型；1：加；2：减")
    @TableField("calc_type")
    private Long calcType;

    @TableField(exist = false)
    private String userName;

    @TableField("location_nb")
    private String locationNb;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField("update_time")
    private Date updateTime;


    @TableField("status")
    private Integer status;

    @TableField(exist = false)
    private String installAddress;


    /** 比率 */
    @Excel(name = "比率")
    @TableField("calc_rate")
    private BigDecimal calcRate;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("tenantId", getTenantId())
            .append("publicShareId", getPublicShareId())
            .append("energyType", getEnergyType())
            .append("userId", getUserId())
            .append("terminalId", getTerminalId())
            .append("publicShareType", getPublicShareType())
            .append("calcType", getCalcType())
            .toString();
    }
}
